package javase.javase01.decorator;

/**
 * @author: Gan
 * @date 2021/4/17 0017 22:28
 * @description:
 **/
public class Demo7 {

    public static void main(String[] args) {
        try(A a = new A()) {
            a.test();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

class A implements AutoCloseable {

    @Override
    public void close() throws Exception {
        System.out.println("close()方法执行了");
    }

    public void test() {
        System.out.println("test方法执行了!");
    }
}